package exam.fourParadigm.S1;

import java.util.*;

public class Main {

    public static int t;
    public static int n;
    public static int k;
    public static int[] a = new int[200001];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            n = sc.nextInt();
            k = sc.nextInt();
            for (int j = 0; j < n; j++) {
                a[j] = sc.nextInt();
            }
            System.out.println(solution());
        }
    }

    private static int solution() {
        if (k > 1) {
            int res = 0;
            for (int i = 1; i < n-1; i++) {
                if (a[i] > a[i+1] + a[i-1])
                    res++;
            }
            return res;
        }
        return (n - 1) / 2;
    }
}
